/* eslint-disable import/no-anonymous-default-export */
import {
    moments, delDynamic
} from '../services/moments';
export default {
    state: {
        momentsData: {},
        delDynamicData: {}
    },
    effects: {
        async moments(params) {

            const response = await moments(params)
            if (response.code === 200) {

                this.saveMoments({
                    momentsData: response.data,

                })
            }
        },
        async delDynamic(params) {
            //
            const response = await delDynamic(params)
            if (response.code === 200) {
                //
                this.saveDelDynamic({
                    delDynamicData: response.data,

                })
            }
        },
    },
    reducers: {
        saveMoments(state, paylode) {
            return {
                ...state,
                ...paylode
            }
        },
        saveDelDynamic(state, paylode) {
            return {
                ...state,
                ...paylode
            }
        },
    }
}